<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Image extends CI_controller {

	public function __construct(){
		parent::__construct();
	}

	public function index($format = false){
		$format = strtolower($format);
		list($width,$height) = explode('x',$format);
		if($width=='') $width=1;
		if($height=='') $height=1;
		@header("Content-Type:image/png"); 
		$im=imagecreate($width,$height); 
		$back=imagecolorallocate($im,0xCC,0xCC,0xCC); 
		$font=imagecolorallocate($im,0,0,0); 
		$str = $width.'x'.$height;
		$len = strlen($str)*9;
		imagestring($im, 5, ($width-$len)/2, ($height-10)/2,$str, $font); 
		imagerectangle($im,0,0,$width-1,$height-1,$back); 
		imagepng($im); 
		imagedestroy($im); 
	}
}
/* End of file image.php */
/* Location: ./application/controllers/image.php */